/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package TimeRecording.enums;

/**
 *
 * @author david
 */
public enum EmployeeStatus {

    UNKNOWN("Unknown"),
    CLOCKED_OUT("Clocked Out"),
    CLOCKED_IN("Clocked In"),
    ON_HOLIDAY("Holiday"),
    ON_SICK("Sickness");

    private String description;

    private EmployeeStatus(String description) {
        this.description = description;
    }

    @Override
    public String toString() {
        return description;
    }

    public static EmployeeStatus fromString(String match) {
        for (EmployeeStatus candidate : values()) {
            if (candidate.description.equals(match)) {
                return candidate;
            }
        }
        return valueOf(match);
    }

}
